import IconWord from "../util/autoIcon/file/icon-word1";
import React from "react";
import IconTXT from "../util/autoIcon/file/icon-txt";
import IconExcel from "../util/autoIcon/file/icon-drivemsexcel-copy-copy";
import IconPPT from "../util/autoIcon/file/icon-ppt";
import IconPDF from "../util/autoIcon/file/icon-PDF";
import Iconweizhi from "../util/autoIcon/file/icon-xingbie-weizhi";
import Iconyasubao from "../util/autoIcon/file/icon-yasuobao";
import IconFont2 from "../util/autoIcon/file";

export default function judegFileType(title){
    let suffixes = title.split(".")
    let suffix = suffixes[suffixes.length-1];
    if(suffix=="doc" || suffix=="docx"){
        return <IconWord type="icon-wendangwenjian"></IconWord>
        // return <IconWord type="icon-word1"></IconWord>
    }
    else if(suffix=="xls" || suffix=="xlsx"){
        return <IconExcel type="icon-drivemsexcel-copy-copy"></IconExcel>
    }
    else if(suffix=="txt" ){
        return <IconTXT type="icon-txt"></IconTXT>
    }
    else if(suffix=="ppt" || suffix=="pptx"){
        return <IconPPT type="icon-ppt"></IconPPT>
    }
    else if(suffix=="pdf"){
        return <IconPDF type="icon-pdf-copy"></IconPDF>
    }
    else if(suffix=="png" || suffix=="jpg" || suffix=="bmp" || suffix=="gif" || suffix=="tif" || suffix=="jpeg" || suffix=="tiff" || suffix=="swf"){
        return <IconFont2 type="icon-tupian"></IconFont2>
    }
    else if(suffix=="zip" || suffix=="gzip" || suffix=="tar" || suffix=="gz" || suffix=="rar"){
        return <Iconyasubao type="icon-yasuobao"></Iconyasubao>
    }
    else{
        return <Iconweizhi type="icon-xingbie-weizhi"></Iconweizhi>
    }
}
